package com.example.demo.mapper;

import com.example.demo.entity.pojo.BookRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface RecordMapper {
    //添加借书纪录
    int borrowBook(@Param("cardId") int cardId, @Param("bookId") int bookId,@Param("type") int type);
    //根据卡id查询借所有借书纪录
    List<BookRecord> getAllBook(@Param("cardId")int cardId);
    //根据类型和卡id查询借书纪录
    List<BookRecord> getBorrowBookByTypeNumber(@Param("cardId")int cardId,@Param("type") int type);

    //根据书籍id获取信息
    BookRecord getBookById(int id);

    //归还书籍
    int returnBook(int id);

    //获取借书记录
    List<BookRecord> getRecord(int id);

    //修改状态
    int changeState(int id, int state);

    //根据书籍名称查询书籍
    List<BookRecord> getRecordByBookName(int id,int cid);
}
